#pragma once

#include "Common.h"
#include "Mesh.h"
#include "Texture.h"
#include "TextureType.h"
#include <vector>
#include "ResourcePtr.h"


namespace Display
{
	struct Texture_TypePair
	{
		ResourcePtr * texturePtr;
		TextureType type;
	};
	
	class RenderPack;

	class EXPORT RenderUnit : DeviceUserBase
	{
		ResourcePtr * meshPtr;
		std::vector<Texture_TypePair*> texPairs;
		std::vector<Texture_TypePair*>::iterator it;
		RenderUnit(void);
		~RenderUnit(void);

		friend class RenderPack;

		 static RenderUnit * Create(ID3D11Device * device);
		 static void Destroy(RenderUnit * pack);

	public:
		

		 Mesh * GetMesh();
		 void SetMesh(ResourcePtr * meshPtr);
		 bool TexTypeLoaded(TextureType type);

		 Texture * GetTextureByType(TextureType type);
		 void SetTextureByType(TextureType type,ResourcePtr * tex);
		
	};
}